import {reqGetCategory} from "@/api";

const state= {
	categoryList:[]  // 初始化数据
};
const getters= {};
const mutations= {
	SET_CATEGORY_STATE(state,payload){
		state.categoryList = payload.categoryList
	}
};
const actions = {
	async getCategory({commit}){
		const result = await reqGetCategory();
		commit('SET_CATEGORY_STATE',{categoryList:result})
	}
};

export default {
	namespaced:true,
	state,
	getters,
	mutations,
	actions
}